#pragma once
#include<istream>
#include<mutex>

class LockGuard
{
public:
	LockGuard(std::mutex* mtx) :_mutex(mtx) {
		_mutex->lock();
	}
	~LockGuard() {
		_mutex->unlock();
	}
	LockGuard(const LockGuard&) = delete;
	LockGuard& operator=(const LockGuard&) = delete;

private:
	std::mutex* _mutex;
};
